/*
 ============================================================================
 Name        : LibreriaConfiguracion.c
 Author      : SOogle
 Version     : 1.0
 Copyright   : All rights reserved
 Description : FUSELAGE - FUSE FAT32 FILE SYSTEM
 ============================================================================
 */

#include "../../headers/GlobalHeader.h"

extern struct_config configuracion;

struct_config cargaConfiguracionInicial();

struct_config cargaConfiguracionInicial()
{

	static struct Configuration *configuration;

	configuration = new(Configuration, "./Config.ini", "=");

	strcpy(configuracion.ModoInicio,ConfigurationClass.getString(configuration, "ModoInicio"));
	strcpy(configuracion.AlgoritmoPlanificacion,ConfigurationClass.getString(configuration, "AlgoritmoPlanificacion"));
	strcpy(configuracion.PathArchivo,ConfigurationClass.getString(configuration, "PathArchivo"));
	strcpy(configuracion.PathLog,ConfigurationClass.getString(configuration, "PathLog"));
	configuracion.PuertoEscuchaPpd=ConfigurationClass.getInt(configuration, "PuertoEscuchaPpd");
	strcpy(configuracion.IPRaid,ConfigurationClass.getString(configuration, "IPRaid"));
	configuracion.PuertoRaid=ConfigurationClass.getInt(configuration, "PuertoRaid");
	configuracion.LogActivado=ConfigurationClass.getInt(configuration, "LogActivado");
	strcpy(configuracion.DiscoID,ConfigurationClass.getString(configuration, "DiscoID"));
	configuracion.Cylinders=ConfigurationClass.getInt(configuration, "Cylinders");
	configuracion.Heads=ConfigurationClass.getInt(configuration, "Heads");
	configuracion.Sectors=ConfigurationClass.getInt(configuration, "Sectors");
	configuracion.tamanioListaScan=ConfigurationClass.getInt(configuration, "tamanioListaScan");
	configuracion.RPM=ConfigurationClass.getInt(configuration, "RPM");
	configuracion.TiempoLectura=ConfigurationClass.getInt(configuration, "TiempoLectura");
	configuracion.TiempoEscritura=ConfigurationClass.getInt(configuration, "TiempoEscritura");
	configuracion.TiempoEntrePistas=ConfigurationClass.getInt(configuration, "TiempoEntrePistas");
	configuracion.tiempoRetardoEscritura=ConfigurationClass.getInt(configuration, "tiempoRetardoEscritura");
	strcpy(configuracion.PathConsola,ConfigurationClass.getString(configuration, "PathConsola"));
	strcpy(configuracion.SocketUNIX,ConfigurationClass.getString(configuration, "SocketUNIX"));

	Configuration_destroyer(configuration);

	return configuracion;
}

